<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>layui</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="__static/lib/layui-v2.5.5/css/layui.css" media="all">
	<link rel="stylesheet" href="__static/css/public.css" media="all">
	<style>
		.layui-form-pane .layui-form-label {
			width: 90px;
		}
	</style>
</head>
<body>
<div class="layuimini-container">
	<div class="layuimini-main">
		<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
	</div>
</div>
<script src="__static/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="__static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script src="__static/js/man.js" charset="utf-8"></script>
<script>

	var $,form,table,laydate
	layui.use(['form', 'table', 'tableSelect', 'laydate'], function () {
		$ = layui.jquery , form = layui.form , table = layui.table , laydate = layui.laydate
		
		var items_id = {$arr.items_id};
		var op_account_id = {$arr.op_account_id};
		var time = {:$arr['time']?$arr['time']:0};
		
		table.render({
			elem: '#currentTableId',
			id:'stat_cu_refund_info',
			url: '{:url("stat_acc_refund_info")}?t=json',
			method : 'post',
			where:{op_account_id:op_account_id,items_id:items_id,time:time},
			toolbar: true,
			cols: [[
				{ field: 'acc_name_id', title: '账户ID'},
				{ field: 'currency', title: '账户币'},
				{ field: 'channel_money', title: '端口退款金额(元)',width:140},
				{ field: 'amount', title: '退客户金额(元)',width:140},
				{ field: 'rebate', title: '端口/销售/客户' ,width:220,  templet: function(d){
			          return d.channel_rebate+' / ' + d.sell_rebates + ' / '+ d.rebate
			    }},
				{ field: 'create_time', title: '退款时间',width:160,  templet: function(d){
			          return d.create_time?date("Y-m-d",d.create_time):''
			    }},
			    { field: 'audit_proof_url', title: '财务凭证',  templet: function(d){
			          return d.audit_proof_url?'<img src="'+d.audit_proof_url+'">':''
			    }},
				{ field: 'customer_name', title: '客户' },
				{ field: 'media_name', title: '媒介' ,width:170},
				{ field: 'note', title: '备注' },
			]],
			
			page: false,
			skin: 'line'
		});
		//监听行单击事件
		table.on('row(currentTableFilter)', function(obj){
			  layer.photos({
				  photos: obj.tr
				  ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
				});
			});
	});
	
	
	
</script>

</body>
</html>